package Pile2;
/**
 *
 */

import java.io.File;
import java.io.FileFilter;
import java.io.FilenameFilter;

public class Test06 {
    public static void main(String[] args) {
        File dir = new File(".");
        if (dir.isDirectory()) {
            File[] subs = dir.listFiles(file -> file.getName().endsWith(".txt"));
            for (File sub : subs) {
                System.out.println(sub.getName()
                );




//        File dir=new File(".");
//        if (dir.isDirectory()){
//            File[]subs=dir.listFiles();
//            System.out.println("获取当前"+subs.length+"子项");
//            for (File sub:subs){
//                System.out.println(sub.getName());
//
//            }
//        }

        }
    }
    }
}
